UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6PsQq2RxootaldltPeaBKTdrTiL7vyb/Zz4b2yRV1oU='
WHERE
key_id = 'b4930d01a2afaf7dfaef6b9d0aafec218aea3f2d184853d32c6b9efe4bbbca4a'
AND (
token = '6PsQq2RxootaldltPeaBKTdrTiL7vyb/Zz4b2yRV1oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)