UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kxFLtcJwHWOXe7VIzMfRitL2J7h5wsWf8ZN7SE+CcRM=' 
WHERE 
  key_id = 'c9ff40f3e16e5184a0dd8e0ced54ef7fe9f7ccdd32e196f2f5c20b4dcc4c1f1f' 
  AND (
    token = 'kxFLtcJwHWOXe7VIzMfRitL2J7h5wsWf8ZN7SE+CcRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073