UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UrtvDt4OJUjwk7f1FgZfeIzJ4aLIhLTmnp9q/DtmiqM=' 
WHERE 
  key_id = '1cfac4d535f5b3b4cee892f651c50f8bb1c8da05de8d28d08b88a085789221f7' 
  AND (
    token = 'UrtvDt4OJUjwk7f1FgZfeIzJ4aLIhLTmnp9q/DtmiqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024