UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HlOPv/mqr9/YeHUEKUlf3NAS0HeaKJjMh5C4gkjQdu4=' 
WHERE 
  key_id = 'a2fcefa0c9cdc5041184eb8822a3dbbaa524261a988904a420ac1319ed52e2d6' 
  AND (
    token = 'HlOPv/mqr9/YeHUEKUlf3NAS0HeaKJjMh5C4gkjQdu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033