UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dU364GfS7O73z8NugIRFFGP+KHZ45dC7VDL/nR9whr4=' 
WHERE 
  key_id = '113312069d6d47e5d258aa376c5a7afc7314f2b9dd172b914d5e22e06ac3b569' 
  AND (
    token = 'dU364GfS7O73z8NugIRFFGP+KHZ45dC7VDL/nR9whr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030