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

Query time 0.00018