UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ds14zmKidHhIOwfYw1gY7CZFsltkSNf5MiXA5H2mKI='
WHERE
key_id = '156dc41dfb9e84a66ac5e26097ddacc3a78ad4af8c1d121902c816acc1a54edf'
AND (
token = '1ds14zmKidHhIOwfYw1gY7CZFsltkSNf5MiXA5H2mKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)