UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UR/VU2sRVc8rd88BiJLCeqwS6gtI6GvNdjOtcgvzHAs=' 
WHERE 
  key_id = 'd17c10165e40390f50b056636070715ad27165744aba245648a6b5d39dd167e1' 
  AND (
    token = 'UR/VU2sRVc8rd88BiJLCeqwS6gtI6GvNdjOtcgvzHAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024