UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gq1vFSHxQxjeOLe2bJ0LUnFc42pZJSZl22mGIwQzWJg=' 
WHERE 
  key_id = '23bf8a26ede85d563db7360fbab724a80cfdd75251fd726ab90cd561dd68c3d7' 
  AND (
    token = 'Gq1vFSHxQxjeOLe2bJ0LUnFc42pZJSZl22mGIwQzWJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028