UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cxOO06IQRMQguB/QQ5zc2FwqYUkzSSav+7jeDQDLefI='
WHERE
key_id = 'df4ed0e61dfbe48c622f960f80d97b06ddefa4f00bb67ff4a7330c780d216a87'
AND (
token = 'cxOO06IQRMQguB/QQ5zc2FwqYUkzSSav+7jeDQDLefI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)