UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '192ZQfMyNer3r7x6rThDFvS9Xt4t6vWopoXYeloV+w0='
WHERE
key_id = '3eb85a1bbda44027b170fea698cb23c7df27881605780cde8469f573eca39db0'
AND (
token = '192ZQfMyNer3r7x6rThDFvS9Xt4t6vWopoXYeloV+w0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)