UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lB3q7JELNUR+4e/M8VC2x30yh0PMuCuWOPp/1I5sRjI='
WHERE
key_id = 'ab61392d7a4749ca7cccc479141f3fe103b45d19920c43d0781ba68db65fe3bf'
AND (
token = 'lB3q7JELNUR+4e/M8VC2x30yh0PMuCuWOPp/1I5sRjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)