UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NFtsOZqdPUkkdMK1sAhyKhpGfO55wX8hYyUvSzHhbhE='
WHERE
key_id = '5a6cd5bfb54eaf844133eef4247d3e8deb90aff0f9fe4461424bef094f1789a6'
AND (
token = 'NFtsOZqdPUkkdMK1sAhyKhpGfO55wX8hYyUvSzHhbhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)