UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZoD/KQx/kZOnbIM1sFLpKYni09GpLx46zdx6TadQ96k=' 
WHERE 
  key_id = 'db0636783471ff172cde31de705eb4832585d42ab3a7a5293ba0a88065006607' 
  AND (
    token = 'ZoD/KQx/kZOnbIM1sFLpKYni09GpLx46zdx6TadQ96k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033