UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VrPBQt5RjtjDOFWcGiXa8sTLbVdzFzC0/FkC4KSSyo=' 
WHERE 
  key_id = '97b4a6d2f1cff926bf652cc3fe543aec046cadec0f1fe346f6bd74dccf08133d' 
  AND (
    token = '1VrPBQt5RjtjDOFWcGiXa8sTLbVdzFzC0/FkC4KSSyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028