UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y+sTa1nVdVZxl47PL3qf7J2stGyVhreAkZj6UiGKhm4='
WHERE
key_id = 'b5c06ac8d30c9529193d2ab0761bf3b0efa6b6cb37534e24c86964659f9cc986'
AND (
token = 'y+sTa1nVdVZxl47PL3qf7J2stGyVhreAkZj6UiGKhm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)