UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3uY/Ra/kP8zUQUnWWRWnRXEX68Q5P7+/Wyf1KvxLvAg=' 
WHERE 
  key_id = 'fd6d6549411125881846d24b0b643fe7769a3951c8ca9c2af9b3af2ca6701d20' 
  AND (
    token = '3uY/Ra/kP8zUQUnWWRWnRXEX68Q5P7+/Wyf1KvxLvAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036