UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xAYTrrgOyEY4FdaBx7ogEdnl40AiI1NKryYIccFvwHI=' 
WHERE 
  key_id = '735244e365b402ef22eee020fe609ea41dcdf8a46a72cc7dbd9511f05dce16e9' 
  AND (
    token = 'xAYTrrgOyEY4FdaBx7ogEdnl40AiI1NKryYIccFvwHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026