UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7YxVVx/FfY9MgCoMDDBVp6xtb7PWCfwpp2fDlzJGds=' 
WHERE 
  key_id = '2ca318eb42deae0989b4a3c0dbb624ee31073eeb178b2df171c19a5d981c1db9' 
  AND (
    token = '+7YxVVx/FfY9MgCoMDDBVp6xtb7PWCfwpp2fDlzJGds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033