UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZT3cUaU9TjB2dj+eDcy+YpPNmfOIJ2w3MRC5Qt6Tas='
WHERE
key_id = '13f1b8ff987bdc1fb71fb04561b4eb9ed6df01671f31dd81f8f12e4ecc191c57'
AND (
token = '8ZT3cUaU9TjB2dj+eDcy+YpPNmfOIJ2w3MRC5Qt6Tas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)