UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w1k/uOZyY2Febs8+A19uv13/rSHW6VkSTCvC/pROR68='
WHERE
key_id = '7c5ca3fa84fd729cc2840ef86c7f240d34d913a3243ad1fb2586258e832985c6'
AND (
token = 'w1k/uOZyY2Febs8+A19uv13/rSHW6VkSTCvC/pROR68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)