UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XyEy02UYMBtkHFbbnC9FO/u42JAtt7fDpPQdbWoIATs=' 
WHERE 
  key_id = '60e372a275c83d28510be0b56b23387ac554c4287c0a8287babeb85ff566cd26' 
  AND (
    token = 'XyEy02UYMBtkHFbbnC9FO/u42JAtt7fDpPQdbWoIATs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027