UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Mu89f4GSanIzm8+YZ6Q31leiUuPwzXoOkQl4vfC+9M='
WHERE
key_id = 'cf0ce5fd2fcc6e80901c7848403a2895537c1422292c00a4af27c97ad2ee9ce8'
AND (
token = '/Mu89f4GSanIzm8+YZ6Q31leiUuPwzXoOkQl4vfC+9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)