UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0eA53uuczc2NKy2R/lW5/Dc85H4V/Z/amlo4agTDKxc='
WHERE
key_id = '4648ca7eafc7fb0170284c2d8d405c9d89e8f0948378a36e2d7683f6fa0ec7aa'
AND (
token = '0eA53uuczc2NKy2R/lW5/Dc85H4V/Z/amlo4agTDKxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)