UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HY3oUdML/qr5W4gDzJLC7aiFDObkBPHhBKcgm6ztC4A='
WHERE
key_id = 'ff2eb87ace94b63efd6f8c4728b4f3a6dde0a411b748aef9255d0a41c1316005'
AND (
token = 'HY3oUdML/qr5W4gDzJLC7aiFDObkBPHhBKcgm6ztC4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)