UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tW2aua+SJ8mYWPd7vLHP1td41eYW2ZvEym7wxtoNwbw=' 
WHERE 
  key_id = '00096c1bf2faae614ea1c86237c3b8ff7607a6e2784e60de5ffe599686cc4bf4' 
  AND (
    token = 'tW2aua+SJ8mYWPd7vLHP1td41eYW2ZvEym7wxtoNwbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041