UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1nH0DyfkirbyOdzQrbzyo3E8VP3YmW9V+zQXqvM21Zw='
WHERE
key_id = 'bfd728d3c31577caea30bffbb05be6fb9dbc264a0a061183c56174f5955d2265'
AND (
token = '1nH0DyfkirbyOdzQrbzyo3E8VP3YmW9V+zQXqvM21Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)