UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJ9Sg5jkRTJ8txcWzWw9pMOwD90oRaBc6h408ZIjKiU=' 
WHERE 
  key_id = '8f37353c84d5c2fc3d875b8de8fcec14b3e196560c6564c23a43fe3cdb712303' 
  AND (
    token = 'LJ9Sg5jkRTJ8txcWzWw9pMOwD90oRaBc6h408ZIjKiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017