UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M1Pphr6oAc8qrHN9QwmGkdYLBM/hzYOLhpkhiArnMEM=' 
WHERE 
  key_id = '39c03f1516a00d82473d553755341762a95daa151c1cc829c25d96a381803189' 
  AND (
    token = 'M1Pphr6oAc8qrHN9QwmGkdYLBM/hzYOLhpkhiArnMEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024