UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JBoNumdf0LiyWiVvYzOdCLT1A7BIH0sqzMU6tJsRFXs=' 
WHERE 
  key_id = '6fc50a775c491d48b74eadaf009b8023f5c1f585edae2dd7aeaa71db9830a54c' 
  AND (
    token = 'JBoNumdf0LiyWiVvYzOdCLT1A7BIH0sqzMU6tJsRFXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028