UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Bf78G0GiF/fmdEtGUwTjxkNWwuW2jaoBnrTVsnaPfs=' 
WHERE 
  key_id = '61d28f6270fbc0990edcd20661912b149a66671367ad7cddc10e9633a72d00fd' 
  AND (
    token = '8Bf78G0GiF/fmdEtGUwTjxkNWwuW2jaoBnrTVsnaPfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032