UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x4HHLfNd7yWzzHSAMIE8wTI4US4nhPu4bb3W89KfwpY='
WHERE
key_id = '938c8a1bd3d236ce90ac84a4ce94ebe07953de2e851f42cea50139a7868ab470'
AND (
token = 'x4HHLfNd7yWzzHSAMIE8wTI4US4nhPu4bb3W89KfwpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)