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

Query time 0.00024