UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXU2TdeA7+YvwbuUQN6ukJ5UOXj2AyNp/Mk9lMUDZYc=' 
WHERE 
  key_id = '7f95ac341a130a0a16490bec8f74e1b47528b9344967a40b75e5c16832c0476a' 
  AND (
    token = 'QXU2TdeA7+YvwbuUQN6ukJ5UOXj2AyNp/Mk9lMUDZYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033