UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1aIKwmiCQ1Y059HQ1P3BA0yLMO3dOmBolzZK8FwH+nw=' 
WHERE 
  key_id = 'ae1ac1ea645fd4ce80d0ccf3218ef788a80483e90af4ab7976ea32888c380d2a' 
  AND (
    token = '1aIKwmiCQ1Y059HQ1P3BA0yLMO3dOmBolzZK8FwH+nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019