UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9S17jz2xEmAGUC9wGEtxsqI4F25K1R/Mmod5zXfS4TE=' 
WHERE 
  key_id = 'ad37031f239ea447262219ab58081daa30be049bfac1aa5db1e063b9b94224c8' 
  AND (
    token = '9S17jz2xEmAGUC9wGEtxsqI4F25K1R/Mmod5zXfS4TE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029