UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6WWZ/Fr+dTdhYp5b6gMe/7idiyb5KzkhX3lrZNj5wbc='
WHERE
key_id = 'e88f1c2058fdfe96cd2ddf652efb1103c1c9a3c44e7ae71d94492b1abae814d8'
AND (
token = '6WWZ/Fr+dTdhYp5b6gMe/7idiyb5KzkhX3lrZNj5wbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)