UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4TYC/E1ahrZEfD+VuY+7AbJlHt+Sksi7gH88VU3d0Rc='
WHERE
key_id = '68c5713963fe52afcee979cf8540fb8447197bc7b210ec7b7d42d8fa012efddc'
AND (
token = '4TYC/E1ahrZEfD+VuY+7AbJlHt+Sksi7gH88VU3d0Rc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)