UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dloj8fVtREs7meB7ZaU+qe7Kigg9jpwfxCNUXtgPT6U=' 
WHERE 
  key_id = 'b5c566f61550bc6ee5c9b43b2ae5657d32c3fd495f1df8268d5d53bf2f694782' 
  AND (
    token = 'Dloj8fVtREs7meB7ZaU+qe7Kigg9jpwfxCNUXtgPT6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028