UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8kc8wqD1jVpA88DZtZYvTutSvqoZavyrexx75EXzYL0='
WHERE
key_id = '89272b0f05d81c808ccd75a142fdadcfb7a1ffe5b3ec06eac29b6ec65089110c'
AND (
token = '8kc8wqD1jVpA88DZtZYvTutSvqoZavyrexx75EXzYL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)