UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w/CBfF6xM8MktA+dcA56OaH/cGABvnZstTzKNANKyO4='
WHERE
key_id = '3c566bfc1d0ba7819c737e94409d4a74a50fdb3fdbc234dbf4196edaec309284'
AND (
token = 'w/CBfF6xM8MktA+dcA56OaH/cGABvnZstTzKNANKyO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)