UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFnAbQTj05oWK14uvKFMHfetU82kmKeae09fkIpnb4I='
WHERE
key_id = '3059330d1b792522b1a8303554cfb7d1d34046cc74c4a83f73e1ec1f60f5d4f4'
AND (
token = 'qFnAbQTj05oWK14uvKFMHfetU82kmKeae09fkIpnb4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)