UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '86/M0ipQz0hllG5tICYuTfEaxrnqHSQHE7ZhvfcFgZc=' 
WHERE 
  key_id = '4ef67b42dae2340cdcc1b73da6f2ea3b0a5edf9ac052e5724a246dd04e799cb5' 
  AND (
    token = '86/M0ipQz0hllG5tICYuTfEaxrnqHSQHE7ZhvfcFgZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025