UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xJnesUuNHk7m1s5/VEwS9HgmYD1NFet4dPwMebCzFZo='
WHERE
key_id = '5342db44e1bdb493f6f60a74b836722be5d315851fbecdd195f4297405104da2'
AND (
token = 'xJnesUuNHk7m1s5/VEwS9HgmYD1NFet4dPwMebCzFZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)