UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gLtqjxgl2iYAqRznd4rmJhW3Gwy4ciDDVVmUp2wYp9c=' 
WHERE 
  key_id = 'a51454f0efbd7591158840e7bc8e5a268a8aa965a38b47be1a1b4180782c70a7' 
  AND (
    token = 'gLtqjxgl2iYAqRznd4rmJhW3Gwy4ciDDVVmUp2wYp9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021