UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pS3Ildsi+NX7x0Dr6Tw97/Ea0HuDCNKfHOiKVXNI+j0='
WHERE
key_id = '26a85f5d9a4bee10e7d979bd2dc453059ba140db722e482ea36c9ac02f487c91'
AND (
token = 'pS3Ildsi+NX7x0Dr6Tw97/Ea0HuDCNKfHOiKVXNI+j0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)