UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7iHLLFm/3l5Ye9o0GGq5O3MHuI4ChzepaM7o0saDaAk=' 
WHERE 
  key_id = '13b4e5b9c1afa429609275c2ecb681dd75dc6e48afe4df55ae5e92e9eae5a1be' 
  AND (
    token = '7iHLLFm/3l5Ye9o0GGq5O3MHuI4ChzepaM7o0saDaAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030