UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yljeicFUWWXVPrvSuWVt8eAqDoykuwHPdYd4SeLyQYU=' 
WHERE 
  key_id = '9313cbf4afafdf0e03fa0f123155ee20515a438f5c97aa0aebb7b9249f28c258' 
  AND (
    token = 'yljeicFUWWXVPrvSuWVt8eAqDoykuwHPdYd4SeLyQYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030