UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PhnNnhSPT+bXWvTM0HuQO/xlj4DCo68vUBsfs56nf38='
WHERE
key_id = '2a4f93df2a87ad2673eada268f9b4c8b9d3c3b72ccf228d31b2cde6f35f45d14'
AND (
token = 'PhnNnhSPT+bXWvTM0HuQO/xlj4DCo68vUBsfs56nf38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)