UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EhsfkNOeMI6ZD9Zl+/LJhcIrAa6FqMgxXFsgV/y5Yc='
WHERE
key_id = '80a2633691b8a5c1cd423bf2a09d4ca78c41dc88383eadd99493f065df6fa31c'
AND (
token = '2EhsfkNOeMI6ZD9Zl+/LJhcIrAa6FqMgxXFsgV/y5Yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)