UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9eMyE/JInnZ5l2z3gn2NmdKHkIKkRQyjLtv3jxK/Ha0='
WHERE
key_id = '8af998bc2e7c6a8e75e93f7f0999148752e6d138865b922dbc0b43089b54ee41'
AND (
token = '9eMyE/JInnZ5l2z3gn2NmdKHkIKkRQyjLtv3jxK/Ha0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)