UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xbj065dKNBkQLKdoGu7fxD/DvNyk3gIkq5cueBXN+yQ=' 
WHERE 
  key_id = '824f464081911ceb2fb8d77c9e9f5aee1c4ce13aa754ad075a7b4983f92b6db3' 
  AND (
    token = 'xbj065dKNBkQLKdoGu7fxD/DvNyk3gIkq5cueBXN+yQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041