UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wsVrVnj9qzu7wD1ugvc+HlgTX2pQ6YEsdmZiOWEaAWw=' 
WHERE 
  key_id = '6cd9ed9adb7035c59d699f4cedbe1c7cf2c292e0126de9f3d206b94c5bb72b07' 
  AND (
    token = 'wsVrVnj9qzu7wD1ugvc+HlgTX2pQ6YEsdmZiOWEaAWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036