UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YxQyFRq4Hhtz1O8QRBANWRcXI1Upkp18aATPT5E+5fY=' 
WHERE 
  key_id = '369ec12ebce1a9729dff884d8a8ff93d43b8e3686b7e416acd61521307d98dd2' 
  AND (
    token = 'YxQyFRq4Hhtz1O8QRBANWRcXI1Upkp18aATPT5E+5fY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020