UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l2dtlg6NYn9wE16IdowFv7j4/d4NGDbCzAHxxOKkEKw=' 
WHERE 
  key_id = '6cc4b51e7eb8861f43e1cd2445b1b3b7353c51304bb8e7ed185a827822ca2b85' 
  AND (
    token = 'l2dtlg6NYn9wE16IdowFv7j4/d4NGDbCzAHxxOKkEKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032